/*
 * @# Album.java 2011-12-23 下午04:55:38
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.px.album.entity;

import javax.validation.constraints.NotNull;

/**
 * @author alvin hwang
 */
public class Album {

	// 秀场
	private static final String SHOW_TYPE = "show";
	// 博文配图
	private static final String POSTS_TYPE = "posts";
	// 头像相册
	private static final String AVATAR_TYPE = "avatar";
	// 名品展示
	private static final String DRESS_TYPE = "dress";
	
	private Long id;
	@NotNull
	private Long userId;
	@NotNull
	private String name;
	private String type;
	private String cover;
	private Long galleryId;
	private String galleryName;
	private String description;
	private String tags;

	private Long createdAt;
	@NotNull
	private Long ipAddr;

	// 缓存数字
	private int photos;
	private int visits;
	private int commentsTotal;
	private int comments;
	private int transferred;
	private int favors;
	private int likes;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getGalleryId() {
		return galleryId;
	}

	public void setGalleryId(Long galleryId) {
		this.galleryId = galleryId;
	}

	public String getGalleryName() {
		return galleryName;
	}

	public void setGalleryName(String galleryName) {
		this.galleryName = galleryName;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public Long getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Long createdAt) {
		this.createdAt = createdAt;
	}

	public Long getIpAddr() {
		return ipAddr;
	}

	public void setIpAddr(Long ipAddr) {
		this.ipAddr = ipAddr;
	}

	public int getPhotos() {
		return photos;
	}

	public void setPhotos(int photos) {
		this.photos = photos;
	}

	public int getCommentsTotal() {
		return commentsTotal;
	}

	public void setCommentsTotal(int commentsTotal) {
		this.commentsTotal = commentsTotal;
	}

	public int getComments() {
		return comments;
	}

	public void setComments(int comments) {
		this.comments = comments;
	}

	public int getTransferred() {
		return transferred;
	}

	public void setTransferred(int transferred) {
		this.transferred = transferred;
	}

	public int getFavors() {
		return favors;
	}

	public void setFavors(int favors) {
		this.favors = favors;
	}

	public int getLikes() {
		return likes;
	}

	public void setLikes(int likes) {
		this.likes = likes;
	}

	public int getVisits() {
		return visits;
	}

	public void setVisits(int visits) {
		this.visits = visits;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Album showType() {
		setType(SHOW_TYPE);
		return this;
	}
	
	public Album postsType() {
		setType(POSTS_TYPE);
		return this;
	}
	
	public Album dressType() {
		setType(DRESS_TYPE);
		return this;
	}
	
	public Album avatarType() {
		setType(AVATAR_TYPE);
		return this;
	}
	
	public boolean isShowType() {
		return SHOW_TYPE.equals(type);
	}
	
	public boolean isPostsType() {
		return POSTS_TYPE.equals(type);
	}
	
	public boolean isDressType() {
		return DRESS_TYPE.equals(type);
	}
	
	public boolean isAvatarType() {
		return AVATAR_TYPE.equals(type);
	}
	
	/**
	 * 是否能对该相册进行编辑? 博文配图/头像相册不能操作.
	 */
	public boolean isUpdatable() {
		return !(isPostsType() || isAvatarType());
	}
}
